package com.augmentum.springcloudorderservice.common;

import lombok.Data;

@Data
public class ServerResult<T> {
    private Integer status;
    private String msg;
    private T data;


    public static <T> ServerResult<T> success(T data) {
        ServerResult<T> result = new ServerResult<T>();
        result.setStatus(0);
        result.setMsg("s");
        result.setData(data);

        return result;
    }

    public static <T> ServerResult<T> fail(String msg) {
        ServerResult<T> serverResult = new ServerResult<>();
        serverResult.setStatus(1);
        serverResult.setMsg(msg);
        return serverResult;
    }
}
